<?php
/**
* Checks if a folder exists.
* @return string Text status
* @return boolean Optionally returns true/false flags
*/
function smarty_modifier_validdirectory($folder='', $quick=false)
{
	$is_valid = $folder && is_dir($folder) && is_writable($folder);
	if($quick!=true)
	{
		$validity = ($is_valid)?
			'<strong style="color:#009900;">VALID, continue</strong>':
			'<strong style="color:#FF0000;">INVALID, correct first</strong>'
		;
	}
	else
	{
		$validity = $is_valid;
	}
	return $validity;
}
?>